home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / tool / wings / w2_src / test_1.c < prev    next >
C/C++ Source or Header  |  1994-11-16  |  1KB  |  69 lines

  1. // 12ドットフォント一覧表示プログラム
  2. //  SP:次のページ BS:前のページ CR:終了
  3. #include <egb.h>
  4. #include <fnt.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <fmcfrb.h>
  8. #include "define.h"
  9.  
  10. void    paging( int );
  11.  
  12. char    egbwork[EgbWorkSize], buff[ 110592 ];
  13.  
  14. void    main( void )
  15. {
  16.  
  17.         int        p;
  18.         UINT    moji, key;
  19.         FILE    *fp;
  20.  
  21.         fp = fopen( "d:\\sysinit\\system.fnt", "rb" );
  22.         fread( buff, 1, 110592, fp );
  23.         fclose( fp );
  24.  
  25.         EGB_init( egbwork, 1536 );
  26.         KYB_init( );
  27.         KYB_clic( 1 );
  28.         p = 0;
  29.         do {
  30.             paging( p );
  31.             do {
  32.                 moji = KYB_read( 1, &key ) % 256;
  33.                 if( moji==8 && p ){
  34.                     p--;
  35.                     break;
  36.                 }
  37.                 if( moji==0x20 && p!=15 ){
  38.                     p++;
  39.                     break;
  40.                 }
  41.                 if( moji==0x0d )
  42.                     return;
  43.             } while( 1 );
  44.         } while( 1 );
  45.  
  46. }
  47. void    paging( int p )
  48. {
  49.  
  50.         int        i, j;
  51.         struct {
  52.             char    *pt;
  53.             short    sel, x1, y1, x2, y2;
  54.         } font = { 0, 0x14, 0, 0, 15, 15 };
  55.  
  56.         EGB_clearScreen( egbwork );
  57.         for( j=0;j<=5;j++ ){
  58.             for( i=0;i<=47;i++ ){
  59.                 font.pt = buff+256*12+i*24+j*48*24+p*48*6*24;
  60.                  font.x1 = i*12;
  61.                 font.y1 = j*12;
  62.                 font.x2 = i*12+11;
  63.                 font.y2 = j*12+11;
  64.                 EGB_putBlockColor( egbwork, 0, ( char *)&font );
  65.             }
  66.         }
  67.  
  68. }
  69.